package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.RepairBbsFallBack;
import cn.cs.fallback.SysDtAreaFallBack;
import cn.cs.pojo.SysDtArea;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = SysDtAreaFallBack.class)
public interface SysDtAreaClient {

    @RequestMapping(value = "/getSysDtAreasByParId", method = RequestMethod.POST)
    public List<SysDtArea> getSysDtAreasByParId(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/getSysDtAreaListByMap", method = RequestMethod.POST)
    public List<SysDtArea> getSysDtAreaListByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAreaLastById", method = RequestMethod.POST)
    public Map<String, Object>	getAreaLastById(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/getSysDtAreaById", method = RequestMethod.POST)
    public Map<String, Object>	getSysDtAreaById(@RequestParam("id") String id)throws Exception;
    @RequestMapping(value = "/getAgentManageProAreas", method = RequestMethod.POST)
    public List<Map<String,Object>> getAgentManageProAreas(@RequestBody Map<String, Object> param);


    @RequestMapping(value = "/getProvinceList", method = RequestMethod.POST)
    public List<Map<String, Object>> getProvinceList() throws Exception;

    @RequestMapping(value = "/getCityListByPid", method = RequestMethod.POST)
    public List<Map<String, Object>> getCityListByPid(@RequestParam("pId") String pId) throws Exception;

    @RequestMapping(value = "/getAreaListByPid", method = RequestMethod.POST)
    public List<Map<String, Object>> getAreaListByPid(@RequestParam("pId") String pId, @RequestBody List<Map<String, Object>> list) throws Exception;

    @RequestMapping(value = "/getAreasListByPid", method = RequestMethod.POST)
    public List<Map<String, Object>> getAreasListByPid(@RequestParam("pId") String pId) throws Exception;

    @RequestMapping(value = "/getCityNameByAreaId", method = RequestMethod.POST)
    public Map<String, Object> getCityNameByAreaId(@RequestParam("areaId") String areaId) throws Exception;


    @RequestMapping(value = "/getAreaProvince", method = RequestMethod.POST)
    public List<Map<String, Object>> getAreaProvince(@RequestParam("list") List<Map<String, Object>> list) throws Exception;

    @RequestMapping(value = "/getAreaCity", method = RequestMethod.POST)
    public List<Map<String, Object>> getAreaCity(@RequestParam("list") List<Map<String, Object>> list, @RequestParam("pId") String pId) throws Exception;

    @RequestMapping(value = "/getAreaArea", method = RequestMethod.POST)
    public List<Map<String, Object>> getAreaArea(@RequestParam("list") List<Map<String, Object>> list, @RequestParam("pId") String pId) throws Exception;

    @RequestMapping(value = "/getAreaListByProvinceId", method = RequestMethod.POST)
    public List<Map<String, Object>> getAreaListByProvinceId(@RequestParam("areaId") String areaId) throws Exception;

    @RequestMapping(value = "/getAreaListByCityId", method = RequestMethod.POST)
    public List<Map<String, Object>> getAreaListByCityId(@RequestParam("areaId") String areaId) throws Exception;

    @RequestMapping(value = "/getAreaListById", method = RequestMethod.POST)
    public List<Map<String, Object>> getAreaListById(@RequestParam("areaId") String areaId) throws Exception;
}

